cmake_minimum_required(VERSION 3.8)
project(robot_serial)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()


find_package(ament_cmake REQUIRED)
find_package(rclcpp REQUIRED)
find_package(serial REQUIRED)

if(BUILD_TESTING)
  find_package(ament_lint_auto REQUIRED)
  set(ament_cmake_copyright_FOUND TRUE)
  set(ament_cmake_cpplint_FOUND TRUE)
  ament_lint_auto_find_test_dependencies()
endif()

ament_package()
add_executable(robot_serial src/main.cpp src/serial_device.cpp)
ament_target_dependencies(robot_serial rclcpp serial)

install(TARGETS
  robot_serial
  DESTINATION lib/${PROJECT_NAME}
)

# launch 文件生成
install(DIRECTORY launch
  DESTINATION share/${PROJECT_NAME})
